# -*- coding:utf-8 -*-
from datetime import datetime
from pydantic import BaseModel, ConfigDict, Field
from pydantic.alias_generators import to_camel
from typing import List, Literal, Optional, Union
from module_admin.annotation.pydantic_annotation import as_query


class BgDownloadRecordModel(BaseModel):
    """
    表对应pydantic模型
    """
    model_config = ConfigDict(alias_generator=to_camel, from_attributes=True, populate_by_name=True)
    create_by: Optional[int] =  Field(default=None, description='创建者')
    create_time: Optional[datetime] =  Field(default=None, description='创建时间')
    begin_create_time: Optional[datetime] =  Field(default=None, description='创建时间最小值')
    end_create_time: Optional[datetime] =  Field(default=None, description='创建时间最大值')
    del_flag: Optional[str] =  Field(default=None, description='删除标志')
    dept_id: Optional[int] =  Field(default=None, description='部门id')
    file_id: Optional[int] =  Field(default=None, description='文件id')
    id: Optional[int] =  Field(default=None, description='id')
    update_time: Optional[datetime] =  Field(default=None, description='更新时间')
    user_id: Optional[int] =  Field(default=None, description='用户id')
    file_name: Optional[str] =  Field(default=None, description='文件名称')
    file_size: Optional[str] =  Field(default=None, description='文件大小')
    file_type: Optional[str] =  Field(default=None, description='文件类型')
    file_cover: Optional[str] =  Field(default=None, description='封面')
    user_name: Optional[str] =  Field(default=None, description='用户名称')
    user_phone: Optional[str] =  Field(default=None, description='用户手机')
    download_ip: Optional[str] =  Field(default=None, description='下载IP')
    download_status: Optional[str] =  Field(default=None, description='下载状态')



@as_query
class BgDownloadRecordPageModel(BgDownloadRecordModel):
    """
    分页查询模型
    """
    page_num: int = Field(default=1, description='当前页码')
    page_size: int = Field(default=10, description='每页记录数')


